<template>
	<view>
		<custom-navigation-bar title="管家后台"></custom-navigation-bar>
		<view class="top">
			<view class="top_1">
				管家名称：{{butlerInfo.name}}
			</view>
			<view class="top_1">
				账户余额：{{butlerInfo.account}} <label class="btn-1">提现</label>
			</view> 
			<view style="width: 100%;height:20rpx;float: left;"></view>
		</view>
		 
		<view class="menu_item" @click="share()">
			<view class="menu_item_1">
				分享记录<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view>
		
		<view class="menu_item" @click="orders()">
			<view class="menu_item_1">
				销售订单<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view>
		
		<view class="menu_item" @click="orders1()">
			<view class="menu_item_1">
				推广订单<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view>
		
		<view class="menu_item" @click="orders2()">
			<view class="menu_item_1">
				下级管家订单<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view> 
		 
		<view class="menu_item" @click="balance">
			<view class="menu_item_1">
				资金明细<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view>
		<view class="menu_item" >
			<view class="menu_item_1">
				提现记录<image src="../../../static/gengduo@3x(1).png" class="menu_item_img"></image>
			</view>
		</view>
		
		 
	</view>
</template>

<script setup> 
	import CustomNavigationBar from '@/components/CustomNavigationBar.vue'
	import http from '../../../utils/http'; 
	function applicationManagement(){
		uni.navigateTo({
			url:"/pages/approve/approve"
		})
	}
	function share(){
		uni.navigateTo({
			url: "/pages/my/butler/share"
		})
	}
	 
	//订单列表
	function orders(){
		uni.navigateTo({
			url: "/pages/my/butler/order?saleUserId="+getApp().globalData.user.userId
		})
	}
	function orders1(){
		uni.navigateTo({
			url: "/pages/my/butler/order?butlerUserId="+getApp().globalData.user.userId
		})
	}
	
	function orders2(){
		uni.navigateTo({
			url: "/pages/my/butler/order?upButlerUserId="+getApp().globalData.user.userId
		})
	}
	
	//评论管理
	function comment(){
		uni.navigateTo({
			url: "/pages/my/shop/comment"
		})
	}
	function balance(){
		uni.navigateTo({
			url:"/pages/my/partner/balance"
		})
	}
	function out(){
		getApp().globalData.shopUserId='';
		wx.switchTab({
		  url: "/pages/my/my",
		  success: function(res) {
		    // 跳转成功
		  },
		  fail: function(err) {
		    // 错误处理
		  }
		})
	}
	
	import {
		onLoad,onShow,
		onPageScroll
	} from '@dcloudio/uni-app';
	const butlerInfo=ref({});
	 
	onLoad((query) => {
		 
	})
	onShow(() => {
		http.request({
		 	url: "/butler/info",
		 	method: "POST",
		 	data: {
		 		"userId":getApp().globalData.user.userId
		 	}
		}).then((responseData) => { 
			 if(responseData.code==1){
				butlerInfo.value=responseData.data;
			 }else if(responseData.code==-1){
				 uni.navigateBack();
			 }
		}).catch((err) => { 
		 	uni.showToast({
		 		icon: 'error',
		 		title: '请求失败'
		 	})
		})
	}) 
	 
</script>

<style>
	.menu_item_2{
		width: 84%;margin-left: 8% ;height: 80rpx;line-height: 80rpx;float:left;text-align: center;font-size: 30rpx;font-weight: bold;
	}
	.menu_item_img{
		width: 40rpx;height: 40rpx;float: right;margin-top: 20rpx;
	}
	.menu_item_1{
		width: 84%;margin-left: 8% ;float: left;height: 80rpx;line-height: 80rpx;float:left;font-size:28rpx;font-weight: bold;
	}
	.menu_item{
		width: 100%;float: left;height: 80rpx;line-height: 80rpx;margin-top: 10rpx;background:white;
	}
	Page{
		background-color: #F2F2F2;
		font-size: 30rpx;
	}
	.btn-1{
		width: auto;border: #969696 3rpx solid;color: #969696;border-radius:10rpx;padding-left: 8rpx;padding-right: 10rpx;font-size: 28rpx;margin-left: 10rpx;
	}
	.top{
		width: 100%;height:auto;margin-top: 150rpx;background: #2AE8DC;float: left;font-size: 30rpx;
	}
	.top_1{
		width: 80%;height: 50rpx;line-height: 50rpx;float: left;margin-left: 10%;color: white;
	}
</style>